_updateOrientationLockIcon() {
let locked = this._orientationSettings.get_boolean('orientation-lock');
- let iconName = locked ? 'rotation-locked-symbolic'
- : 'rotation-allowed-symbolic';
+ let iconName = locked
+ ? 'rotation-locked-symbolic'
+ : 'rotation-allowed-symbolic';
this._actions.get(LOCK_ORIENTATION_ACTION_ID).iconName = iconName;
this.notify('orientation-lock-icon');
if (this._clone.source)
this._clone.source.sync_visibility();
- let windowActor = this._window ? this._window.get_compositor_private()
- : null;
+ let windowActor = this._window
+ ? this._window.get_compositor_private() : null;
if (windowActor)
windowActor.hide();
}
_createAppIcon(app, size) {
- let appIcon = app ? app.create_icon_texture(size)
- : new St.Icon({ icon_name: 'icon-missing',
- icon_size: size });
+ let appIcon = app
+ ? app.create_icon_texture(size)
+ : new St.Icon({ icon_name: 'icon-missing', icon_size: size });
appIcon.x_expand = appIcon.y_expand = true;
appIcon.x_align = appIcon.y_align = Clutter.ActorAlign.END;
else
this._views[i].control.remove_style_pseudo_class('checked');
- let animationDirection = i == activeIndex ? IconGrid.AnimationDirection.IN :
- IconGrid.AnimationDirection.OUT;
+ let animationDirection = i == activeIndex
+ ? IconGrid.AnimationDirection.IN
+ : IconGrid.AnimationDirection.OUT;
this._views[i].view.animateSwitch(animationDirection);
}
}
);
windows.forEach(window => {
- let title = window.title ? window.title
- : this._source.app.get_name();
+ let title = window.title
+ ? window.title : this._source.app.get_name();
let item = this._appendMenuItem(title);
item.connect('activate', () => {
this.emit('activate-window', window);
if (row == 2)
styleClass = `calendar-day-top ${styleClass}`;
- let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
- : iter.getDay() == this._weekStart;
+ let leftMost = rtl
+ ? iter.getDay() == (this._weekStart + 6) % 7
+ : iter.getDay() == this._weekStart;
if (leftMost)
styleClass = `calendar-day-left ${styleClass}`;
*/
title = C_("event list time", "All Day");
} else {
- let date = this._event.date >= periodBegin ? this._event.date
- : this._event.end;
+ let date = this._event.date >= periodBegin
+ ? this._event.date
+ : this._event.end;
title = Util.formatTime(date, { timeOnly: true });
}
constructor() {
this._prompter = new Gcr.SystemPrompter();
this._prompter.connect('new-prompt', () => {
- let dialog = this._enabled ? new KeyringDialog()
- : new KeyringDummyDialog();
+ let dialog = this._enabled
+ ? new KeyringDialog()
+ : new KeyringDummyDialog();
this._currentPrompt = dialog.prompt;
return this._currentPrompt;
});
{ datetime: GLib.DateTime.new_from_unix_local (message.timestamp),
bannerMarkup: true });
- let group = (message.direction == NotificationDirection.RECEIVED ?
- 'received' : 'sent');
+ let group = (message.direction == NotificationDirection.RECEIVED
+ ? 'received' : 'sent');
this._append({ body: messageBody,
group: group,
// SCROLLBACK_RECENT_LENGTH previous messages. Otherwise
// we'll keep SCROLLBACK_IDLE_LENGTH messages.
- let maxLength = (lastMessageTime < currentTime - SCROLLBACK_RECENT_TIME) ?
- SCROLLBACK_IDLE_LENGTH : SCROLLBACK_RECENT_LENGTH;
+ let maxLength = (lastMessageTime < currentTime - SCROLLBACK_RECENT_TIME)
+ ? SCROLLBACK_IDLE_LENGTH : SCROLLBACK_RECENT_LENGTH;
let filteredHistory = this.messages.filter(item => item.realMessage);
if (filteredHistory.length > maxLength) {
}
// App moved
- let nextApp = newApps.length > newIndex + 1 ? newApps[newIndex + 1]
- : null;
+ let nextApp = newApps.length > newIndex + 1
+ ? newApps[newIndex + 1] : null;
let insertHere = nextApp && nextApp == oldApp;
let alreadyRemoved = removedActors.reduce((result, actor) => {
let removedApp = actor.child._delegate.app;
});
let layout = this._grid.layout_manager;
- let title = (this._locations.length == 0) ? _("Add world clocks…")
- : _("World Clocks");
+ let title = (this._locations.length == 0)
+ ? _("Add world clocks…")
+ : _("World Clocks");
let header = new St.Label({ style_class: 'world-clocks-header',
x_align: Clutter.ActorAlign.START,
text: title });
return [0, 0];
let nChildren = this.get_n_children();
- let nColumns = this._colLimit ? Math.min(this._colLimit,
- nChildren)
- : nChildren;
+ let nColumns = this._colLimit
+ ? Math.min(this._colLimit, nChildren)
+ : nChildren;
let totalSpacing = Math.max(0, nColumns - 1) * this._getSpacing();
// Kind of a lie, but not really an issue right now. If
// we wanted to support some sort of hidden/overflow that would
let neededWidth = this.usedWidthForNColumns(this._minColumns) - availWidth;
let neededHeight = this.usedHeightForNRows(this._minRows) - availHeight;
- let neededSpacePerItem = (neededWidth > neededHeight) ? Math.ceil(neededWidth / this._minColumns)
- : Math.ceil(neededHeight / this._minRows);
+ let neededSpacePerItem = (neededWidth > neededHeight)
+ ? Math.ceil(neededWidth / this._minColumns)
+ : Math.ceil(neededHeight / this._minRows);
this._fixedHItemSize = Math.max(this._hItemSize - neededSpacePerItem, MIN_ICON_SIZE);
this._fixedVItemSize = Math.max(this._vItemSize - neededSpacePerItem, MIN_ICON_SIZE);
let childrenPerRow = this._childrenPerPage / this._rowsPerPage;
let sourceRow = Math.floor((index - pageOffset) / childrenPerRow);
- let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1
- : sourceRow;
+ let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1 : sourceRow;
let nRowsBelow = this._rowsPerPage - nRowsAbove;
let nRowsUp, nRowsDown;
let name = this._app ? this._app.get_name() : this._window.title;
/* Translators: %s is an application name like "Settings" */
- let title = name ? _("%s wants to inhibit shortcuts").format(name)
- : _("Application wants to inhibit shortcuts");
+ let title = name
+ ? _("%s wants to inhibit shortcuts").format(name)
+ : _("Application wants to inhibit shortcuts");
let icon = new Gio.ThemedIcon({ name: 'dialog-warning-symbolic' });
let contentParams = { icon, title };
this.keyboardBox.ease({
anchor_y: 0,
opacity: 0,
- duration: immediate ? 0
- : KEYBOARD_ANIMATION_TIME,
+ duration: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_IN_QUAD,
onComplete: () => {
this._hideKeyboardComplete();
index = this._findActor(ancestor);
}
- let ancestorData = ancestor ? this._trackedActors[index]
- : defaultParams;
+ let ancestorData = ancestor
+ ? this._trackedActors[index]
+ : defaultParams;
// We can't use Params.parse here because we want to drop
// the extra values like ancestorData.actor
for (let prop in defaultParams) {
}
get narrowestPrivacyScope() {
- return this.notifications.every(n => n.privacyScope == PrivacyScope.SYSTEM) ? PrivacyScope.SYSTEM
- : PrivacyScope.USER;
+ return this.notifications.every(n => n.privacyScope == PrivacyScope.SYSTEM)
+ ? PrivacyScope.SYSTEM
+ : PrivacyScope.USER;
}
setTitle(newTitle) {
}
let isPlaying = this._player.status == 'Playing';
- let iconName = isPlaying ? 'media-playback-pause-symbolic'
- : 'media-playback-start-symbolic';
+ let iconName = isPlaying
+ ? 'media-playback-pause-symbolic'
+ : 'media-playback-start-symbolic';
this._playPauseButton.child.icon_name = iconName;
this._updateNavButton(this._prevButton, this._player.canGoPrevious);
notification.setTransient(!!hints['transient']);
let privacyScope = (hints['x-gnome-privacy-scope'] || 'user');
- notification.setPrivacyScope(privacyScope == 'system' ? MessageTray.PrivacyScope.SYSTEM
- : MessageTray.PrivacyScope.USER);
+ notification.setPrivacyScope(privacyScope == 'system'
+ ? MessageTray.PrivacyScope.SYSTEM
+ : MessageTray.PrivacyScope.USER);
let sourceGIcon = source.useNotificationIcon ? gicon : null;
source.processNotification(notification, sourceGIcon);
let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
this.setUrgency(urgency != undefined ? urgency : MessageTray.Urgency.NORMAL);
} else if (urgent) {
- this.setUrgency(urgent.unpack() ? MessageTray.Urgency.CRITICAL
- : MessageTray.Urgency.NORMAL);
+ this.setUrgency(urgent.unpack()
+ ? MessageTray.Urgency.CRITICAL
+ : MessageTray.Urgency.NORMAL);
} else {
this.setUrgency(MessageTray.Urgency.NORMAL);
}
function getRtlSlideDirection(direction, actor) {
let rtl = (actor.text_direction == Clutter.TextDirection.RTL);
if (rtl)
- direction = (direction == SlideDirection.LEFT) ?
- SlideDirection.RIGHT : SlideDirection.LEFT;
+ direction = (direction == SlideDirection.LEFT)
+ ? SlideDirection.RIGHT : SlideDirection.LEFT;
return direction;
}
// flags only determine what to do if the allocated box is bigger
// than the actor's box.
let realDirection = getRtlSlideDirection(this._direction, child);
- let alignX = (realDirection == SlideDirection.LEFT) ? (availWidth - natWidth)
- : (availWidth - natWidth * this._slideX);
+ let alignX = (realDirection == SlideDirection.LEFT)
+ ? availWidth - natWidth
+ : availWidth - natWidth * this._slideX;
let actorBox = new Clutter.ActorBox();
actorBox.x1 = box.x1 + alignX + this._translationX;
offset = children[0].width;
let isAnimationIn = animationDirection == AnimationDirection.IN;
- let delay = isAnimationIn ? INDICATORS_ANIMATION_DELAY :
- INDICATORS_ANIMATION_DELAY_OUT;
+ let delay = isAnimationIn
+ ? INDICATORS_ANIMATION_DELAY
+ : INDICATORS_ANIMATION_DELAY_OUT;
let baseTime = isAnimationIn ? INDICATORS_BASE_TIME : INDICATORS_BASE_TIME_OUT;
let totalAnimationTime = baseTime + delay * this._nPages;
- let maxTime = isAnimationIn ? INDICATORS_ANIMATION_MAX_TIME :
- INDICATORS_ANIMATION_MAX_TIME_OUT;
+ let maxTime = isAnimationIn
+ ? INDICATORS_ANIMATION_MAX_TIME
+ : INDICATORS_ANIMATION_MAX_TIME_OUT;
if (totalAnimationTime > maxTime)
delay -= (totalAnimationTime - maxTime) / this._nPages;
}
_changeMenu(newMenu) {
- newMenu.open(this.activeMenu ? BoxPointer.PopupAnimation.FADE
- : BoxPointer.PopupAnimation.FULL);
+ newMenu.open(this.activeMenu
+ ? BoxPointer.PopupAnimation.FADE
+ : BoxPointer.PopupAnimation.FULL);
}
_onMenuSourceEnter(menu) {
let body = '';
if (n.bannerBodyText) {
- body = n.bannerBodyMarkup ? n.bannerBodyText
- : GLib.markup_escape_text(n.bannerBodyText, -1);
+ body = n.bannerBodyMarkup
+ ? n.bannerBodyText
+ : GLib.markup_escape_text(n.bannerBodyText, -1);
}
let label = new St.Label({ style_class: 'screen-shield-notification-count-text' });
navigateFocus(direction) {
let rtl = this.actor.get_text_direction() == Clutter.TextDirection.RTL;
if (direction == St.DirectionType.TAB_BACKWARD ||
- direction == (rtl ? St.DirectionType.RIGHT
- : St.DirectionType.LEFT) ||
+ direction == (rtl
+ ? St.DirectionType.RIGHT
+ : St.DirectionType.LEFT) ||
direction == St.DirectionType.UP) {
this.actor.navigate_focus(null, direction, false);
return;
isLocked: false,
isPrimary: true,
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
- components: Config.HAVE_NETWORKMANAGER ?
- ['networkAgent', 'polkitAgent', 'telepathyClient',
- 'keyring', 'autorunManager', 'automountManager'] :
- ['polkitAgent', 'telepathyClient',
- 'keyring', 'autorunManager', 'automountManager'],
+ components: Config.HAVE_NETWORKMANAGER
+ ? ['networkAgent', 'polkitAgent', 'telepathyClient',
+ 'keyring', 'autorunManager', 'automountManager']
+ : ['polkitAgent', 'telepathyClient',
+ 'keyring', 'autorunManager', 'automountManager'],
panel: {
left: ['activities', 'appMenu'],
item.prop = prop;
radioGroup.push(item);
item.radioGroup = radioGroup;
- item.setOrnament(prop.get_state() == IBus.PropState.CHECKED ?
- PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
+ item.setOrnament(prop.get_state() == IBus.PropState.CHECKED
+ ? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
item.connect('activate', () => {
if (item.prop.get_state() == IBus.PropState.CHECKED)
return;
_updateMenuLabels() {
if (this._settings.get_boolean(ENABLED)) {
- this._item.label.text = this._indicator.visible ? _("Location In Use")
- : _("Location Enabled");
+ this._item.label.text = this._indicator.visible
+ ? _("Location In Use")
+ : _("Location Enabled");
this._onOffAction.label.text = _("Disable");
} else {
this._item.label.text = _("Location Disabled");
let visible = this._proxy.NightLightActive;
let disabled = this._proxy.DisabledUntilTomorrow;
- this._item.label.text = disabled ? _("Night Light Disabled")
- : _("Night Light On");
- this._disableItem.label.text = disabled ? _("Resume")
- : _("Disable Until Tomorrow");
+ this._item.label.text = disabled
+ ? _("Night Light Disabled")
+ : _("Night Light On");
+ this._disableItem.label.text = disabled
+ ? _("Resume")
+ : _("Disable Until Tomorrow");
this._item.visible = this._indicator.visible = visible;
}
};
}
_updateSliderIcon() {
- this._icon.icon_name = (this._hasHeadphones ?
- 'audio-headphones-symbolic' :
- 'audio-speakers-symbolic');
+ this._icon.icon_name = (this._hasHeadphones
+ ? 'audio-headphones-symbolic'
+ : 'audio-speakers-symbolic');
}
_portChanged() {
}
_onShowAppsButtonToggled() {
- this._showPage(this._showAppsButton.checked ?
- this._appsPage : this._workspacesPage);
+ this._showPage(this._showAppsButton.checked
+ ? this._appsPage : this._workspacesPage);
}
_onStageKeyPress(actor, event) {
}
_searchCancelled() {
- this._showPage(this._showAppsButton.checked ? this._appsPage
- : this._workspacesPage);
+ this._showPage(this._showAppsButton.checked
+ ? this._appsPage
+ : this._workspacesPage);
// Leave the entry focused when it doesn't have any text;
// when replacing a selected search term, Clutter emits